3.3.50 \(\int (a+b \tan ^2(c+d x))^4 \, dx\) [250]

3.3.50.1 Optimal result
3.3.50.2 Mathematica [A] (verified)
3.3.50.3 Rubi [A] (verified)
3.3.50.4 Maple [A] (verified)
3.3.50.5 Fricas [A] (verification not implemented)
3.3.50.6 Sympy [B] (verification not implemented)
3.3.50.7 Maxima [A] (verification not implemented)
3.3.50.8 Giac [B] (verification not implemented)
3.3.50.9 Mupad [B] (verification not implemented)

3.3.50.1 Optimal result

Integrand size = 14, antiderivative size = 115 \[ \int \left (a+b \tan ^2(c+d x)\right )^4 \, dx=(a-b)^4 x+\frac {(2 a-b) b \left (2 a^2-2 a b+b^2\right ) \tan (c+d x)}{d}+\frac {b^2 \left (6 a^2-4 a b+b^2\right ) \tan ^3(c+d x)}{3 d}+\frac {(4 a-b) b^3 \tan ^5(c+d x)}{5 d}+\frac {b^4 \tan ^7(c+d x)}{7 d} \]

output
(a-b)^4*x+(2*a-b)*b*(2*a^2-2*a*b+b^2)*tan(d*x+c)/d+1/3*b^2*(6*a^2-4*a*b+b^ 
2)*tan(d*x+c)^3/d+1/5*(4*a-b)*b^3*tan(d*x+c)^5/d+1/7*b^4*tan(d*x+c)^7/d
 
3.3.50.2 Mathematica [A] (verified)

Time = 2.35 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.19 \[ \int \left (a+b \tan ^2(c+d x)\right )^4 \, dx=\frac {\tan (c+d x) \left (\frac {105 (a-b)^4 \text {arctanh}\left (\sqrt {-\tan ^2(c+d x)}\right )}{\sqrt {-\tan ^2(c+d x)}}+b \left (105 \left (4 a^3-6 a^2 b+4 a b^2-b^3\right )+35 b \left (6 a^2-4 a b+b^2\right ) \tan ^2(c+d x)+21 (4 a-b) b^2 \tan ^4(c+d x)+15 b^3 \tan ^6(c+d x)\right )\right )}{105 d} \]

input
Integrate[(a + b*Tan[c + d*x]^2)^4,x]
 
output
(Tan[c + d*x]*((105*(a - b)^4*ArcTanh[Sqrt[-Tan[c + d*x]^2]])/Sqrt[-Tan[c 
+ d*x]^2] + b*(105*(4*a^3 - 6*a^2*b + 4*a*b^2 - b^3) + 35*b*(6*a^2 - 4*a*b 
 + b^2)*Tan[c + d*x]^2 + 21*(4*a - b)*b^2*Tan[c + d*x]^4 + 15*b^3*Tan[c + 
d*x]^6)))/(105*d)
 
3.3.50.3 Rubi [A] (verified)

Time = 0.29 (sec) , antiderivative size = 113, normalized size of antiderivative = 0.98, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 4144, 300, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \left (a+b \tan ^2(c+d x)\right )^4 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \left (a+b \tan (c+d x)^2\right )^4dx\)

\(\Big \downarrow \) 4144

\(\displaystyle \frac {\int \frac {\left (b \tan ^2(c+d x)+a\right )^4}{\tan ^2(c+d x)+1}d\tan (c+d x)}{d}\)

\(\Big \downarrow \) 300

\(\displaystyle \frac {\int \left (b^4 \tan ^6(c+d x)+(4 a-b) b^3 \tan ^4(c+d x)+b^2 \left (6 a^2-4 b a+b^2\right ) \tan ^2(c+d x)+(2 a-b) b \left (2 a^2-2 b a+b^2\right )+\frac {(a-b)^4}{\tan ^2(c+d x)+1}\right )d\tan (c+d x)}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\frac {1}{3} b^2 \left (6 a^2-4 a b+b^2\right ) \tan ^3(c+d x)+b (2 a-b) \left (2 a^2-2 a b+b^2\right ) \tan (c+d x)+(a-b)^4 \arctan (\tan (c+d x))+\frac {1}{5} b^3 (4 a-b) \tan ^5(c+d x)+\frac {1}{7} b^4 \tan ^7(c+d x)}{d}\)

input
Int[(a + b*Tan[c + d*x]^2)^4,x]
 
output
((a - b)^4*ArcTan[Tan[c + d*x]] + (2*a - b)*b*(2*a^2 - 2*a*b + b^2)*Tan[c 
+ d*x] + (b^2*(6*a^2 - 4*a*b + b^2)*Tan[c + d*x]^3)/3 + ((4*a - b)*b^3*Tan 
[c + d*x]^5)/5 + (b^4*Tan[c + d*x]^7)/7)/d
 

3.3.50.3.1 Defintions of rubi rules used

rule 300
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Int 
[PolynomialDivide[(a + b*x^2)^p, (c + d*x^2)^(-q), x], x] /; FreeQ[{a, b, c 
, d}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && ILtQ[q, 0] && GeQ[p, -q]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4144
Int[((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_), x_Symbol] :> 
With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[c*(ff/f)   Subst[Int[(a + b* 
(ff*x)^n)^p/(c^2 + ff^2*x^2), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, 
 b, c, e, f, n, p}, x] && (IntegersQ[n, p] || IGtQ[p, 0] || EqQ[n^2, 4] || 
EqQ[n^2, 16])
 
3.3.50.4 Maple [A] (verified)

Time = 0.10 (sec) , antiderivative size = 133, normalized size of antiderivative = 1.16

method result size
norman \(\left (a^{4}-4 a^{3} b +6 a^{2} b^{2}-4 a \,b^{3}+b^{4}\right ) x +\frac {b \left (4 a^{3}-6 a^{2} b +4 a \,b^{2}-b^{3}\right ) \tan \left (d x +c \right )}{d}+\frac {b^{4} \tan \left (d x +c \right )^{7}}{7 d}+\frac {b^{2} \left (6 a^{2}-4 a b +b^{2}\right ) \tan \left (d x +c \right )^{3}}{3 d}+\frac {\left (4 a -b \right ) b^{3} \tan \left (d x +c \right )^{5}}{5 d}\) \(133\)
parts \(a^{4} x +\frac {b^{4} \left (\frac {\tan \left (d x +c \right )^{7}}{7}-\frac {\tan \left (d x +c \right )^{5}}{5}+\frac {\tan \left (d x +c \right )^{3}}{3}-\tan \left (d x +c \right )+\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {4 a \,b^{3} \left (\frac {\tan \left (d x +c \right )^{5}}{5}-\frac {\tan \left (d x +c \right )^{3}}{3}+\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {6 a^{2} b^{2} \left (\frac {\tan \left (d x +c \right )^{3}}{3}-\tan \left (d x +c \right )+\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {4 a^{3} b \left (\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}\) \(167\)
derivativedivides \(\frac {\frac {b^{4} \tan \left (d x +c \right )^{7}}{7}+\frac {4 a \,b^{3} \tan \left (d x +c \right )^{5}}{5}-\frac {b^{4} \tan \left (d x +c \right )^{5}}{5}+2 a^{2} b^{2} \tan \left (d x +c \right )^{3}-\frac {4 a \,b^{3} \tan \left (d x +c \right )^{3}}{3}+\frac {b^{4} \tan \left (d x +c \right )^{3}}{3}+4 a^{3} b \tan \left (d x +c \right )-6 a^{2} b^{2} \tan \left (d x +c \right )+4 a \,b^{3} \tan \left (d x +c \right )-b^{4} \tan \left (d x +c \right )+\left (a^{4}-4 a^{3} b +6 a^{2} b^{2}-4 a \,b^{3}+b^{4}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) \(173\)
default \(\frac {\frac {b^{4} \tan \left (d x +c \right )^{7}}{7}+\frac {4 a \,b^{3} \tan \left (d x +c \right )^{5}}{5}-\frac {b^{4} \tan \left (d x +c \right )^{5}}{5}+2 a^{2} b^{2} \tan \left (d x +c \right )^{3}-\frac {4 a \,b^{3} \tan \left (d x +c \right )^{3}}{3}+\frac {b^{4} \tan \left (d x +c \right )^{3}}{3}+4 a^{3} b \tan \left (d x +c \right )-6 a^{2} b^{2} \tan \left (d x +c \right )+4 a \,b^{3} \tan \left (d x +c \right )-b^{4} \tan \left (d x +c \right )+\left (a^{4}-4 a^{3} b +6 a^{2} b^{2}-4 a \,b^{3}+b^{4}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) \(173\)
parallelrisch \(\frac {15 b^{4} \tan \left (d x +c \right )^{7}+84 a \,b^{3} \tan \left (d x +c \right )^{5}-21 b^{4} \tan \left (d x +c \right )^{5}+210 a^{2} b^{2} \tan \left (d x +c \right )^{3}-140 a \,b^{3} \tan \left (d x +c \right )^{3}+35 b^{4} \tan \left (d x +c \right )^{3}+105 a^{4} d x -420 a^{3} b d x +630 a^{2} b^{2} d x -420 a \,b^{3} d x +105 b^{4} d x +420 a^{3} b \tan \left (d x +c \right )-630 a^{2} b^{2} \tan \left (d x +c \right )+420 a \,b^{3} \tan \left (d x +c \right )-105 b^{4} \tan \left (d x +c \right )}{105 d}\) \(179\)
risch \(a^{4} x -4 a^{3} b x +6 a^{2} b^{2} x -4 a \,b^{3} x +b^{4} x -\frac {8 i b \left (-1575 a^{3} {\mathrm e}^{8 i \left (d x +c \right )}+315 b^{3} {\mathrm e}^{10 i \left (d x +c \right )}-630 a^{3} {\mathrm e}^{10 i \left (d x +c \right )}-161 a \,b^{2}+210 a^{2} b -105 a^{3}+44 b^{3}-812 a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+1155 a^{2} b \,{\mathrm e}^{2 i \left (d x +c \right )}+2835 a^{2} b \,{\mathrm e}^{4 i \left (d x +c \right )}-2121 a \,b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-3080 a \,b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-2555 a \,b^{2} {\mathrm e}^{8 i \left (d x +c \right )}+3990 a^{2} b \,{\mathrm e}^{6 i \left (d x +c \right )}+3360 a^{2} b \,{\mathrm e}^{8 i \left (d x +c \right )}+1575 a^{2} b \,{\mathrm e}^{10 i \left (d x +c \right )}-1260 a \,b^{2} {\mathrm e}^{10 i \left (d x +c \right )}-315 a \,b^{2} {\mathrm e}^{12 i \left (d x +c \right )}+315 a^{2} b \,{\mathrm e}^{12 i \left (d x +c \right )}+105 b^{3} {\mathrm e}^{12 i \left (d x +c \right )}+203 b^{3} {\mathrm e}^{2 i \left (d x +c \right )}-105 a^{3} {\mathrm e}^{12 i \left (d x +c \right )}-630 a^{3} {\mathrm e}^{2 i \left (d x +c \right )}+609 b^{3} {\mathrm e}^{4 i \left (d x +c \right )}+770 b^{3} {\mathrm e}^{6 i \left (d x +c \right )}-1575 a^{3} {\mathrm e}^{4 i \left (d x +c \right )}-2100 a^{3} {\mathrm e}^{6 i \left (d x +c \right )}+770 b^{3} {\mathrm e}^{8 i \left (d x +c \right )}\right )}{105 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{7}}\) \(426\)

input
int((a+b*tan(d*x+c)^2)^4,x,method=_RETURNVERBOSE)
 
output
(a^4-4*a^3*b+6*a^2*b^2-4*a*b^3+b^4)*x+b*(4*a^3-6*a^2*b+4*a*b^2-b^3)/d*tan( 
d*x+c)+1/7*b^4*tan(d*x+c)^7/d+1/3*b^2*(6*a^2-4*a*b+b^2)*tan(d*x+c)^3/d+1/5 
*(4*a-b)*b^3*tan(d*x+c)^5/d
 
3.3.50.5 Fricas [A] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.17 \[ \int \left (a+b \tan ^2(c+d x)\right )^4 \, dx=\frac {15 \, b^{4} \tan \left (d x + c\right )^{7} + 21 \, {\left (4 \, a b^{3} - b^{4}\right )} \tan \left (d x + c\right )^{5} + 35 \, {\left (6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} \tan \left (d x + c\right )^{3} + 105 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} d x + 105 \, {\left (4 \, a^{3} b - 6 \, a^{2} b^{2} + 4 \, a b^{3} - b^{4}\right )} \tan \left (d x + c\right )}{105 \, d} \]

input
integrate((a+b*tan(d*x+c)^2)^4,x, algorithm="fricas")
 
output
1/105*(15*b^4*tan(d*x + c)^7 + 21*(4*a*b^3 - b^4)*tan(d*x + c)^5 + 35*(6*a 
^2*b^2 - 4*a*b^3 + b^4)*tan(d*x + c)^3 + 105*(a^4 - 4*a^3*b + 6*a^2*b^2 - 
4*a*b^3 + b^4)*d*x + 105*(4*a^3*b - 6*a^2*b^2 + 4*a*b^3 - b^4)*tan(d*x + c 
))/d
 
3.3.50.6 Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 209 vs. \(2 (100) = 200\).

Time = 0.23 (sec) , antiderivative size = 209, normalized size of antiderivative = 1.82 \[ \int \left (a+b \tan ^2(c+d x)\right )^4 \, dx=\begin {cases} a^{4} x - 4 a^{3} b x + \frac {4 a^{3} b \tan {\left (c + d x \right )}}{d} + 6 a^{2} b^{2} x + \frac {2 a^{2} b^{2} \tan ^{3}{\left (c + d x \right )}}{d} - \frac {6 a^{2} b^{2} \tan {\left (c + d x \right )}}{d} - 4 a b^{3} x + \frac {4 a b^{3} \tan ^{5}{\left (c + d x \right )}}{5 d} - \frac {4 a b^{3} \tan ^{3}{\left (c + d x \right )}}{3 d} + \frac {4 a b^{3} \tan {\left (c + d x \right )}}{d} + b^{4} x + \frac {b^{4} \tan ^{7}{\left (c + d x \right )}}{7 d} - \frac {b^{4} \tan ^{5}{\left (c + d x \right )}}{5 d} + \frac {b^{4} \tan ^{3}{\left (c + d x \right )}}{3 d} - \frac {b^{4} \tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \tan ^{2}{\left (c \right )}\right )^{4} & \text {otherwise} \end {cases} \]

input
integrate((a+b*tan(d*x+c)**2)**4,x)
 
output
Piecewise((a**4*x - 4*a**3*b*x + 4*a**3*b*tan(c + d*x)/d + 6*a**2*b**2*x + 
 2*a**2*b**2*tan(c + d*x)**3/d - 6*a**2*b**2*tan(c + d*x)/d - 4*a*b**3*x + 
 4*a*b**3*tan(c + d*x)**5/(5*d) - 4*a*b**3*tan(c + d*x)**3/(3*d) + 4*a*b** 
3*tan(c + d*x)/d + b**4*x + b**4*tan(c + d*x)**7/(7*d) - b**4*tan(c + d*x) 
**5/(5*d) + b**4*tan(c + d*x)**3/(3*d) - b**4*tan(c + d*x)/d, Ne(d, 0)), ( 
x*(a + b*tan(c)**2)**4, True))
 
3.3.50.7 Maxima [A] (verification not implemented)

Time = 0.41 (sec) , antiderivative size = 162, normalized size of antiderivative = 1.41 \[ \int \left (a+b \tan ^2(c+d x)\right )^4 \, dx=a^{4} x - \frac {4 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a^{3} b}{d} + \frac {2 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, d x + 3 \, c - 3 \, \tan \left (d x + c\right )\right )} a^{2} b^{2}}{d} + \frac {4 \, {\left (3 \, \tan \left (d x + c\right )^{5} - 5 \, \tan \left (d x + c\right )^{3} - 15 \, d x - 15 \, c + 15 \, \tan \left (d x + c\right )\right )} a b^{3}}{15 \, d} + \frac {{\left (15 \, \tan \left (d x + c\right )^{7} - 21 \, \tan \left (d x + c\right )^{5} + 35 \, \tan \left (d x + c\right )^{3} + 105 \, d x + 105 \, c - 105 \, \tan \left (d x + c\right )\right )} b^{4}}{105 \, d} \]

input
integrate((a+b*tan(d*x+c)^2)^4,x, algorithm="maxima")
 
output
a^4*x - 4*(d*x + c - tan(d*x + c))*a^3*b/d + 2*(tan(d*x + c)^3 + 3*d*x + 3 
*c - 3*tan(d*x + c))*a^2*b^2/d + 4/15*(3*tan(d*x + c)^5 - 5*tan(d*x + c)^3 
 - 15*d*x - 15*c + 15*tan(d*x + c))*a*b^3/d + 1/105*(15*tan(d*x + c)^7 - 2 
1*tan(d*x + c)^5 + 35*tan(d*x + c)^3 + 105*d*x + 105*c - 105*tan(d*x + c)) 
*b^4/d
 
3.3.50.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 2209 vs. \(2 (109) = 218\).

Time = 2.32 (sec) , antiderivative size = 2209, normalized size of antiderivative = 19.21 \[ \int \left (a+b \tan ^2(c+d x)\right )^4 \, dx=\text {Too large to display} \]

input
integrate((a+b*tan(d*x+c)^2)^4,x, algorithm="giac")
 
output
1/105*(105*a^4*d*x*tan(d*x)^7*tan(c)^7 - 420*a^3*b*d*x*tan(d*x)^7*tan(c)^7 
 + 630*a^2*b^2*d*x*tan(d*x)^7*tan(c)^7 - 420*a*b^3*d*x*tan(d*x)^7*tan(c)^7 
 + 105*b^4*d*x*tan(d*x)^7*tan(c)^7 - 735*a^4*d*x*tan(d*x)^6*tan(c)^6 + 294 
0*a^3*b*d*x*tan(d*x)^6*tan(c)^6 - 4410*a^2*b^2*d*x*tan(d*x)^6*tan(c)^6 + 2 
940*a*b^3*d*x*tan(d*x)^6*tan(c)^6 - 735*b^4*d*x*tan(d*x)^6*tan(c)^6 - 420* 
a^3*b*tan(d*x)^7*tan(c)^6 + 630*a^2*b^2*tan(d*x)^7*tan(c)^6 - 420*a*b^3*ta 
n(d*x)^7*tan(c)^6 + 105*b^4*tan(d*x)^7*tan(c)^6 - 420*a^3*b*tan(d*x)^6*tan 
(c)^7 + 630*a^2*b^2*tan(d*x)^6*tan(c)^7 - 420*a*b^3*tan(d*x)^6*tan(c)^7 + 
105*b^4*tan(d*x)^6*tan(c)^7 + 2205*a^4*d*x*tan(d*x)^5*tan(c)^5 - 8820*a^3* 
b*d*x*tan(d*x)^5*tan(c)^5 + 13230*a^2*b^2*d*x*tan(d*x)^5*tan(c)^5 - 8820*a 
*b^3*d*x*tan(d*x)^5*tan(c)^5 + 2205*b^4*d*x*tan(d*x)^5*tan(c)^5 - 210*a^2* 
b^2*tan(d*x)^7*tan(c)^4 + 140*a*b^3*tan(d*x)^7*tan(c)^4 - 35*b^4*tan(d*x)^ 
7*tan(c)^4 + 2520*a^3*b*tan(d*x)^6*tan(c)^5 - 4410*a^2*b^2*tan(d*x)^6*tan( 
c)^5 + 2940*a*b^3*tan(d*x)^6*tan(c)^5 - 735*b^4*tan(d*x)^6*tan(c)^5 + 2520 
*a^3*b*tan(d*x)^5*tan(c)^6 - 4410*a^2*b^2*tan(d*x)^5*tan(c)^6 + 2940*a*b^3 
*tan(d*x)^5*tan(c)^6 - 735*b^4*tan(d*x)^5*tan(c)^6 - 210*a^2*b^2*tan(d*x)^ 
4*tan(c)^7 + 140*a*b^3*tan(d*x)^4*tan(c)^7 - 35*b^4*tan(d*x)^4*tan(c)^7 - 
3675*a^4*d*x*tan(d*x)^4*tan(c)^4 + 14700*a^3*b*d*x*tan(d*x)^4*tan(c)^4 - 2 
2050*a^2*b^2*d*x*tan(d*x)^4*tan(c)^4 + 14700*a*b^3*d*x*tan(d*x)^4*tan(c)^4 
 - 3675*b^4*d*x*tan(d*x)^4*tan(c)^4 - 84*a*b^3*tan(d*x)^7*tan(c)^2 + 21...
 
3.3.50.9 Mupad [B] (verification not implemented)

Time = 10.81 (sec) , antiderivative size = 164, normalized size of antiderivative = 1.43 \[ \int \left (a+b \tan ^2(c+d x)\right )^4 \, dx=\frac {\mathrm {atan}\left (\frac {\mathrm {tan}\left (c+d\,x\right )\,{\left (a-b\right )}^4}{a^4-4\,a^3\,b+6\,a^2\,b^2-4\,a\,b^3+b^4}\right )\,{\left (a-b\right )}^4}{d}+\frac {b^4\,{\mathrm {tan}\left (c+d\,x\right )}^7}{7\,d}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^3\,\left (2\,a^2\,b^2-\frac {4\,a\,b^3}{3}+\frac {b^4}{3}\right )}{d}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^5\,\left (\frac {4\,a\,b^3}{5}-\frac {b^4}{5}\right )}{d}+\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (4\,a^3\,b-6\,a^2\,b^2+4\,a\,b^3-b^4\right )}{d} \]

input
int((a + b*tan(c + d*x)^2)^4,x)
 
output
(atan((tan(c + d*x)*(a - b)^4)/(a^4 - 4*a^3*b - 4*a*b^3 + b^4 + 6*a^2*b^2) 
)*(a - b)^4)/d + (b^4*tan(c + d*x)^7)/(7*d) + (tan(c + d*x)^3*(b^4/3 - (4* 
a*b^3)/3 + 2*a^2*b^2))/d + (tan(c + d*x)^5*((4*a*b^3)/5 - b^4/5))/d + (tan 
(c + d*x)*(4*a*b^3 + 4*a^3*b - b^4 - 6*a^2*b^2))/d